package day17;

import java.util.Scanner;
//计算某字符出现的次数
public class oj1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String strs = "";
        String find = "";
        int count = 0;

        while(sc.hasNext()) {
            strs = sc.nextLine();
            find = sc.nextLine();
            for(char s:strs.toCharArray()) {
                //不区分大小写
                if(find.equalsIgnoreCase(String.valueOf(s))) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
